package com.gds.wiki.cloud.framework.common.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class PhoneUtils {
    public static String phoneWtihAsterisk(String mobiles) {
        String phoneNumber = mobiles.substring(0, 3) + "****" + mobiles.substring(7, mobiles.length());
        return phoneNumber;
    }


    public static boolean isMobile(String mobiles) {
        Pattern p = Pattern.compile("^1(3|5|7|8|4)\\d{9}");
        Matcher m = p.matcher(mobiles);
        return m.matches();
    }
}
